1. Field of the Invention
The present invention relates to a system and a method for controlling the traveling of a tape, and more particularly, to a system and method for controlling the traveling of a tape in a tape drive which temporarily stores data transmitted from a higher-level system and then writes the data to the tape.
2. Background Information
A tape drive for writing data to a tape such as a magnetic tape temporarily stores data in a buffer, and then writes the data from the buffer to a tape at a convenient timing for the drive. To ensure that all the data transmitted to the drive is written to the tape, a host transmits to the drive a command for forcing the drive to write the data (WriteFM Non Immediate command). Such forced write from the buffer to the tape is called “synchronization”.
If the tape is not stopped after the synchronization, a gap occurs between the data written in the preceding synchronization and the data subsequently written on the tape. As a result, part of the recording area of the tape is not used. To use more of the tape, a “backhitch” operation, hereinafter backhitch, needs to be performed. A backhitch is a series of the following operations: reducing the traveling speed of the tape to temporarily stop the tape; moving the tape in the reverse direction; thereafter moving the tape in the forward direction again to reach a position to which the subsequent data should be written; and finally writing the subsequent data to that position. The writing of the subsequent data cannot be performed before this backhitch is completed. Since a backhitch requires approximately two to three seconds, influence of the backhitch on performance of the tape drive is significant.
As a technique for avoiding such a situation, a Recursive Accumulating Backhitchless Flush (RABF) has been proposed. For example, when receiving a synchronous request, a tape drive writes data that is stored in a buffer and has not been written yet to a tape, to a temporary recording area (ABF wrap) allocated on the tape, while the tape drive keeps the tape continuously traveling. Such writing is called backhitchless flush (buffer flush without backhitch). In backhitchless flush, no backhitch is performed, since during ABF wrap writing, a gap between the data written in the preceding synchronization and the data written in the subsequent synchronization is not considered as a problem. Concurrently, the tape drive performs recursive write, which performs operations of accumulating data in the buffer during ABF wrap writing, and of rewriting the data to a normal recording area (standard wrap) of the tape, when either the buffer or the temporary recording area becomes full. Thus, in the RABF, synchronization requires no backhitch for the subsequent synchronization. Accordingly, the time required for synchronization may be reduced. The RABF may substantially enhance performance of tape drives where a synchronous request is made at a high frequency with respect to data amounts.
Thus, the RABF may enhance the synchronization performance of tape drives where the data amount transmitted from a host in a synchronous request (such data amount referred to as a “transaction size” below) is small. Accordingly, data of a certain transaction size or larger leads to an increase in overhead during the operations of writing data in a different location for temporary recording and of rewriting the data to a normal location. In such a case, data can be written faster by performing a backhitch than the RABF. Accordingly, there is a need for a technique for enhancing synchronous performance in a case where a transaction size is large.
Additionally, a backhitch may be performed when the buffer runs out of data to be written to the tape before completing writing data of a transaction size. This backhitch allows the tape drive to start writing the data again from a position of the tape subsequent to the position the last data is written, avoiding the tape to continuously move ahead, so as not to waste the capacity of the tape. Accordingly, there is a need for a technique that reduces any decrease in performance due to such a backhitch.